import service from './request'


// 后台登录接口
export function Login(data){
    return service.post('/login',data)  
}
//展示教职工列表
export function GetAdminUser({pagenum,pagesize,query}) {
    return service.get('/adminusers?page='+pagenum+'&page_size='+pagesize+'&name='+query)
}
// 添加职工账号
export function addAdminUser(data) {
    return service.post('/adminusers',data)
}
//删除职工账号
export function removeAdminUser(id) {
    return service.delete('/adminusers/'+id)
}
// 根据id获取用户信息
export function getAdminuserById(id){
    return service.get('/adminusers/'+id)
}
//修改用户状态
export function updateAdminUserState({id,is_active}) {
    return service.put('/adminusers/'+id,{is_active})
}
// 修改用户的角色
export function updateAdminuserInfo(id,params){
    return service.put('/adminusers/'+id,params)
}
//获取某个学院所有的讲师和导员
export function getTeacherByClassId(class_id) {
    return service.get('/teachers?class_id='+class_id)

}

//查看个人信息
export function chackMessage(){
    return service.get("/chackMessage")
}

//删除用户的角色
export function DeleteAdminUserInfo(id){
    return service.delete('/delAdminRole?id='+id)
}
